package com.yl.chainStore.common.enums

import com.baomidou.mybatisplus.annotation.EnumValue
import com.fasterxml.jackson.annotation.JsonValue

enum class CustomerShowEnum(@EnumValue val code: Int, @JsonValue val typeName: String){

	GREEN(1,"绿色"),

	BLUE(2,"蓝色"),

	YELLOW(3,"黄色"),

	RED(4,"红色"),

	BLACK(5,"黑色"),

	/**
	 * 其他
	 */
	OTHER(32760, "其他");

	companion object {
		fun getEnum(d: Int?): CustomerShowEnum {
			return values().find { it.code == (d ?: return OTHER) } ?: OTHER
		}
	}

	fun getMap():MutableMap<String,Any>{
		val map = mutableMapOf<String,Any>()
		map["id"] = this.typeName
		map["name"] = this.typeName
		return map
	}

}
